/*
 * Copyright 2010. 
 * 
 * This document may not be reproduced, distributed or used 
 * in any manner whatsoever without the expressed written 
 * permission of xrkol Corp. 
 * 
 * $Rev: Rev $
 * $Author: Author $
 * $LastChangedDate: LastChangedDate $
 *
 */

package com.xrkol.sharelib.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xrkol.sharelib.dao.MessageDao;
import com.xrkol.sharelib.entity.Message;
import com.xrkol.sharelib.entity.Teacher;
import com.xrkol.sharelib.service.MessageService;

/**
 * @author peng.xia
 *
 */
@Service
@Transactional
public class MessageServiceImpl implements MessageService{

    @Autowired
    private MessageDao messageDao; 
    
    @Override
    public void save(Message entity) {
        this.messageDao.save(entity);
    }

    @Override
    public void update(Message entity) {
        this.messageDao.update(entity);
    }

    @Override
    public void delete(String id) {
        this.messageDao.delete(id);
    }

    @Override
    public Message findById(String id) {
        return this.messageDao.findById(id);
    }

    @Override
    public List<Message> getMessagesByUserWithPaginate(Teacher currentUser, Integer page) {
        return this.messageDao.getMessagesByUserWithPaginate(currentUser, page);
    }

}
